
/*
 * Copyright 2002-2013 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 *版权所有2002-2013原作者。
 *
 *根据Apache许可证2.0版（“许可证”）获得许可；
 *除非符合许可证，否则不得使用此文件。
 *您可以在以下地址获取许可证副本：
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 *除非适用法律要求或书面同意，软件
 *根据许可证分发的内容是按“原样”分发的，
 *无任何明示或暗示的保证或条件。
 *有关管理权限和
 *许可证下的限制。
 */

package org.springframework.beans;

import java.beans.BeanInfo;
import java.beans.IntrospectionException;

import org.springframework.lang.Nullable;

/**
 * Strategy interface for creating {@link BeanInfo} instances for Spring beans.
 * Can be used to plug in custom bean property resolution strategies (e.g. for other
 * languages on the JVM) or more efficient {@link BeanInfo} retrieval algorithms.
 *
 * <p>BeanInfoFactories are instantiated by the {@link CachedIntrospectionResults},
 * by using the {@link org.springframework.core.io.support.SpringFactoriesLoader}
 * utility class.
 *
 * When a {@link BeanInfo} is to be created, the {@code CachedIntrospectionResults}
 * will iterate through the discovered factories, calling {@link #getBeanInfo(Class)}
 * on each one. If {@code null} is returned, the next factory will be queried.
 * If none of the factories support the class, a standard {@link BeanInfo} will be
 * created as a default.
 *
 * <p>Note that the {@link org.springframework.core.io.support.SpringFactoriesLoader}
 * sorts the {@code BeanInfoFactory} instances by
 * {@link org.springframework.core.annotation.Order @Order}, so that ones with a
 * higher precedence come first.
 *
 * @author Arjen Poutsma
 * @since 3.2
 * @see CachedIntrospectionResults
 * @see org.springframework.core.io.support.SpringFactoriesLoader
 */
/**
 *用于为Spring bean创建｛@link BeanInfo｝实例的策略接口。
 *可用于插入自定义bean属性解析策略（例如
 *JVM上的语言）或更高效的｛@link BeanInfo｝检索算法。
 *
 *＜p＞BeanInfoFactories由｛@link CachedIntrossectionResults｝实例化，
 *通过使用{@link.org.springframework.core.io.support.SpringFactoriesLoader}
 *公用事业类。
 *
 *当要创建｛@link BeanInfo｝时，｛@code CachedIntrossectionResults｝
 *将遍历发现的工厂，调用｛@link#getBeanInfo（Class）｝
 *在每一个上。如果返回｛@code null｝，将查询下一个工厂。
 *如果没有工厂支持该类，则标准的｛@link BeanInfo｝将是
 *创建为默认值。
 *
 *＜p＞注意｛@linkorg.springframework.core.io.support.SpringFactoriesLoader｝
 *对｛@code BeanInfoFactory｝实例进行排序
 *｛@link org.springframework.core.annotation.Order@Order｝，因此
 *优先顺序较高。
 *
 *@作者Arjen Poutsma
 *@自3.2
 *@参见CachedIntrossectionResults
 *@参见org.springframework.core.io.support.SpringFactoriesLoader
 */
public interface BeanInfoFactory {

	/**
	 * Return the bean info for the given class, if supported.
	 * @param beanClass the bean class
	 * @return the BeanInfo, or {@code null} if the given class is not supported
	 * @throws IntrospectionException in case of exceptions
	 */
	/**
	 *返回给定类的bean信息（如果支持）。
	 *@param beanClass bean类
	 *@return BeanInfo，如果不支持给定的类，则返回｛@code null｝
	 *出现异常时@throws IntrospectionException
	 */
	@Nullable
	BeanInfo getBeanInfo(Class<?> beanClass) throws IntrospectionException;

}
